import RadioWsUtil from "../utils/radio/radioWsUtil"

export default {
  data() {
    return {
      radioTool: null,
    }
  },
  mounted() {

  },
  methods: {
    initRadioWs(onRecChange, onRecEnd, onRecStop) {
      this.radioTool = new RadioWsUtil();
      this.radioTool.setRecChange(onRecChange);
      this.radioTool.setRecEnd(onRecEnd);
      this.radioTool.setRecStop(onRecStop);
    },
    startRecord() {
      console.log('开启录音')
      this.radioTool.start();
    },
    stopRecord() {
      this.radioTool.stop();
    }
  },
}